package seata.service.impl;

import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import seata.dao.SeataTable1Mapper;
import seata.feign.SeataTable3Client;
import seata.feign.SeataTable2Client;
import seata.service.SeataTable1Service;

@Service()
public class SeataTable1ServiceImpl implements SeataTable1Service {
    @Autowired
    private SeataTable2Client seataTable2Client;

    @Autowired
    private SeataTable3Client seataTable3Client;

    @Autowired
    private SeataTable1Mapper seataTable1Mapper;

    @Override
    @GlobalTransactional
    public void updateSeataTableOneToThree(String name1, String name2, String name3){
        seataTable1Mapper.updateSeataTableById(1,name1);
        seataTable2Client.update(name2);
        seataTable3Client.update(name3);
    }
}
